import request from '@/utils/request'

/**
 * 分页获取
 */
export function getExpendByPage(params, pageNum, pageSize, token) {
    return request({
        url: '/expend/list/page',
        method: 'get',
        params: {
            ...params,
            pageNum,
            pageSize,
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 保存
 */
export function addOrUpdateExpend(data, token) {
    return request({
        url: '/expend/addOrUpdate',
        method: 'post',
        params: {
            ...data
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 支出信息详情
 */
export function getExpendDetail(id, token) {
    return request({
        url: '/expend/getExpendDetail/' + id,
        method: 'get',
        headers: {
            'token': token
        }
    })
}

/**
 * 删除支出信息
 */
export function delExpendById(id, token) {
    return request({
        url: '/expend/delExpendById/' + id,
        method: 'post',
        headers: {
            'token': token
        }
    })
}